#ifndef DESIGN_OBSERVER_H_
#define DESIGN_OBSERVER_H_
#include <list>
namespace observer{

class Observer;

class Subject
{
public:
    void registerObserver(Observer* o);
    void removeObserver(Observer* o);
    void notifyObserver();
private:
    std::list<Observer*> m_obj;
};

class Observer
{
public:
    virtual void update() = 0;
};

class DisplayElement
{
public:
    virtual void display() = 0;
};

///////////////////////////////////
class WeatherData: public Subject
{
public:
    int getTemperature(){return this->t;}
    int getHumidity(){return this->h;}
    int getPressure(){return this->p;}
private:
    int t; //temperature
    int h; //humidity
    int p; //pressure
};
////////////////////////////////////

class CurrentConditionDisplay:public Observer,DisplayElement
{
public:
    void update();
    void display();
};

class StatisticsDisplay:public Observer,DisplayElement
{
public:
    void update();
    void display();
};

class ForecastDisplay:public Observer,DisplayElement
{
public:
    void update();
    void display();
};

class ThirdPartyDisplay:public Observer,DisplayElement
{
public:
    void update();
    void display();
};

}
#endif // DESIGN_OBSERVER_H_
